package com.service.impl;

import com.dao.IOrderDao;
import com.domain.Orders;
import com.github.pagehelper.PageHelper;
import com.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 项目名称：ssm21
 * 类 名 称：OrderServiceImpl
 * 类 描 述：TODO
 * 创建时间：2020-01-16 12:01
 */
@Service
@Transactional
public class OrderServiceImpl implements IOrderService {
    @Autowired
    private IOrderDao iOrderDao;

    @Override
    public List<Orders> findAll(int page, int size) throws Exception {
        // 页面值, 每页显示条数
        PageHelper.startPage(page, size);
        return iOrderDao.findAll(page, size);
    }

    @Override
    public Orders findById(String ordersId) throws Exception {
        return iOrderDao.findById(ordersId);
    }
}
